
#ifndef TOOLS_DEFINE
#define TOOLS_DEFINE

#include <cstdint>
#include <memory>
#include <functional>
#include <string>
#include "../channel.h"
#include "../loop.h"
#include "../../socket_module/socket_module_define.h"
#include "../../log_module/log_module_define.h"

class Connection;


using OnConnection =std::function<void(std::shared_ptr<Connection> connection)>;
using DisConnection=std::function<void(std::shared_ptr<Connection> connection)>;
using OnMessage    =std::function<void(std::shared_ptr<Connection> connection, std::shared_ptr<SocketBuffer> buffer)>;
using OnError      =std::function<void(std::shared_ptr<Connection> connection, const std::string & error_msg)>;


using ClientMessage = std::function<void(std::shared_ptr<SocketBuffer>)>;
using ClientError   = std::function<void(std::string)>;
using ClientConnect = std::function<void(std::shared_ptr<SocketBuffer>)>;


#endif
